bondscell_results0$1086228a-e28d-45c7-9153-c79378239e54queued¤logsrunning¦outputbodyc

To learn more, take a look at the other featured notebooks!

mimetext/htmlrootassigneelast_run_timestampAڃ(persist_js_state·has_pluto_hook_features§cell_id$1086228a-e28d-45c7-9153-c79378239e54depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$cdbcc440-858c-11ee-25d2-dd9d69531eefqueued¤logsrunning¦outputbody

Pluto for Jupyter users

Jupyter is another open source notebook environment, that works with Julia, Python, and R. If you're already familiar with Jupyter and are now trying out Pluto, this notebook is for you!

We'll go over some key differences between Pluto and Jupyter. Let's get started!

mimetext/htmlrootassigneelast_run_timestampAڃ i^persist_js_state·has_pluto_hook_features§cell_id$cdbcc440-858c-11ee-25d2-dd9d69531eefdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$2b91d104-921a-4d66-ac1f-a940cdb2d14cqueued¤logsrunning¦outputbody)

This is also fine in Jupyter, but it's discouraged. Running cells yourself is easier when you can run things top-to-bottom, and the "run all cells" command also requires your cells work like that.

Because Pluto analyses the dependencies in your code, playing with the order of cells is no problem at all! You can place cells in the order that you want to present them in – you might want to show results first, and put your functions and calculations at the bottom of the notebook.

mimetext/htmlrootassigneelast_run_timestampAڃ%uհpersist_js_state·has_pluto_hook_features§cell_id$2b91d104-921a-4d66-ac1f-a940cdb2d14cdepends_on_disabled_cells§runtimeSgpublished_object_keysdepends_on_skipped_cells§errored$40ff93d6-1755-4258-9c15-3ae7be681d93queued¤logsrunning¦outputbodyF

Wrapping up

That's it!

I encourage you to make your own notebooks and play around with Pluto yourself. You can also take a look at Pluto's featured notebooks (on the home page) which show you a bit more of what you can do with Pluto!

mimetext/htmlrootassigneelast_run_timestampAڃwpersist_js_state·has_pluto_hook_features§cell_id$40ff93d6-1755-4258-9c15-3ae7be681d93depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$447f49ce-1738-4987-a976-094174971ccbqueued¤logsrunning¦outputbody٣

Re-assigning variables

Here' s something that you cannot do in Pluto:

mimetext/htmlrootassigneelast_run_timestampAڃ)Bpersist_js_state·has_pluto_hook_features§cell_id$447f49ce-1738-4987-a976-094174971ccbdepends_on_disabled_cells§runtime xpublished_object_keysdepends_on_skipped_cells§errored$5dd0949a-82d1-4b27-8318-9b42065d0957queued¤logsrunning¦outputbodymsguMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.stacktraceplain_erroruMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampAڃ—!persist_js_state·has_pluto_hook_features§cell_id$5dd0949a-82d1-4b27-8318-9b42065d0957depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6queued¤logsrunning¦outputbodyٴ

Now we have two global variables, yourname and count that we can use in other cells:

mimetext/htmlrootassigneelast_run_timestampAڃ(<Ѱpersist_js_state·has_pluto_hook_features§cell_id$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbqueued¤logsrunning¦outputbody1mimetext/plainrootassigneeappleslast_run_timestampAڃ™ pΰpersist_js_state·has_pluto_hook_features§cell_id$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$c702dde3-6cb4-4444-ab1d-f1db95e6776aqueued¤logsrunning¦outputbodybmimetext/htmlrootassigneelast_run_timestampAڃš'persist_js_state·has_pluto_hook_features§cell_id$c702dde3-6cb4-4444-ab1d-f1db95e6776adepends_on_disabled_cells§runtime.published_object_keysdepends_on_skipped_cells§errored$4e75b797-dbba-4d2e-843e-4abb0f8de22cqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃqpersist_js_state·has_pluto_hook_features§cell_id$4e75b797-dbba-4d2e-843e-4abb0f8de22cdepends_on_disabled_cells§runtimeKpublished_object_keysdepends_on_skipped_cells§errored$2a84a64a-b819-4246-8f77-99679691da61queued¤logsrunning¦outputbody

Interactivity with @bind

You can use @bind and PlutoUI.jl to write interactive notebooks!

mimetext/htmlrootassigneelast_run_timestampAڃ'|persist_js_state·has_pluto_hook_features§cell_id$2a84a64a-b819-4246-8f77-99679691da61depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃ#/persist_js_state·has_pluto_hook_features§cell_id$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5queued¤logsrunning¦outputbody

Reproducibility

The package manager does some other neat stuff too. As you're probably aware, the good folks maintaining packages will release new versions over time. That's great, but it can cause issues with compatibility.

Because of this, it can be useful if you've written down somewhere which versions of each package you were using - and if you're running someone else's code, you can avoid errors by using the same versions they used.

In Pluto all of that happens automatically: your package environment is stored inside the notebook file. When someone else opens your notebook with Pluto, the exact same package environment will be used, and packages will work on their computer.

mimetext/htmlrootassigneelast_run_timestampAڃq볰persist_js_state·has_pluto_hook_features§cell_id$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5depends_on_disabled_cells§runtime\*published_object_keysdepends_on_skipped_cells§errored$a423fc4f-6000-4451-bc03-4035c9847753queued¤logsrunning¦outputbodyw

Reactivity

The most notable difference between Pluto and Jupyter is reactivity.

Here we have two cells: one defines apples, and one defines oranges, which depends on apples. Try changing the value of apples here, and see what happens!

mimetext/htmlrootassigneelast_run_timestampAڃ opersist_js_state·has_pluto_hook_features§cell_id$a423fc4f-6000-4451-bc03-4035c9847753depends_on_disabled_cells§runtime ,̵published_object_keysdepends_on_skipped_cells§errored$d3cf365d-ef7e-4a48-a32d-b050e69e5075queued¤logsrunning¦outputbody

Tip

If you're used to doing your own package management and you don't want Pluto to take over, don't worry! When you use Pkg.activate(...) inside a notebook, the package manager will be disabled.

mimetext/htmlrootassigneelast_run_timestampAڃrWpersist_js_state·has_pluto_hook_features§cell_id$d3cf365d-ef7e-4a48-a32d-b050e69e5075depends_on_disabled_cells§runtime+published_object_keysdepends_on_skipped_cells§errored$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3equeued¤logsrunning¦outputbody"🐭🐭🐭"mimetext/plainrootassigneegroup_of_micelast_run_timestampAڃ™\persist_js_state·has_pluto_hook_features§cell_id$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3edepends_on_disabled_cells§runtimee@published_object_keysdepends_on_skipped_cells§errored$016f9e48-1672-481e-b642-d0c6bf67a5bcqueued¤logsrunning¦outputbodyk

This cell contains some text in Markdown!

mimetext/htmlrootassigneelast_run_timestampAڃt=persist_js_state·has_pluto_hook_features§cell_id$016f9e48-1672-481e-b642-d0c6bf67a5bcdepends_on_disabled_cells§runtime5B>published_object_keysdepends_on_skipped_cells§errored$4720cedc-502b-4c66-9c4a-98622c87cb04queued¤logsrunning¦outputbody

But that's slow!

In Julia, packages are always installed globally, while environments (including notebooks) only store version information, not the package code itself. This means that multiple notebooks that use the same version of Plots will not lead to more disk usage or precompile time.

This is different from venv in Python/pip, or node_modules in NodeJS/npm, where every environment contains copies of package code by default. Julia's package manager is designed to work well with many package environments on the same computer.

mimetext/htmlrootassigneelast_run_timestampAڃqapersist_js_state·has_pluto_hook_features§cell_id$4720cedc-502b-4c66-9c4a-98622c87cb04depends_on_disabled_cells§runtime ʂpublished_object_keysdepends_on_skipped_cells§errored$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0queued¤logsrunning¦outputbody!

Markdown cells

Unlike Jupyter, Pluto doesn't have text cells or markdown cells. Every cell is just Julia code. However, you can write markdown expressions in Julia, and those will be nicely displayed by Pluto. Like this:

mimetext/htmlrootassigneelast_run_timestampAڃsXpersist_js_state·has_pluto_hook_features§cell_id$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0depends_on_disabled_cells§runtime[.published_object_keysdepends_on_skipped_cells§errored$5200e802-8080-4394-aa85-e2604c7279c8queued¤logsrunning¦outputbody

Multiple expressions per cell

When you start programming your first Pluto notebook, you'll probably run in to this error:

mimetext/htmlrootassigneelast_run_timestampAڃ+Xpersist_js_state·has_pluto_hook_features§cell_id$5200e802-8080-4394-aa85-e2604c7279c8depends_on_disabled_cells§runtime4tpublished_object_keysdepends_on_skipped_cells§errored$9c3cfd5e-b89c-4df2-9982-d581e9fc3730queued¤logsrunning¦outputbodyC

Hidden output

Just like in Jupyter and the Julia REPL, you can hide output by adding a ; at the end of you code.

For example: this cell has visible code but hidden output.

mimetext/htmlrootassigneelast_run_timestampAڃ'Kpersist_js_state·has_pluto_hook_features§cell_id$9c3cfd5e-b89c-4df2-9982-d581e9fc3730depends_on_disabled_cells§runtime opublished_object_keysdepends_on_skipped_cells§errored$ec2bcfd5-bd38-4801-ac38-2339bc782147queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃ(^Jpersist_js_state·has_pluto_hook_features§cell_id$ec2bcfd5-bd38-4801-ac38-2339bc782147depends_on_disabled_cells§runtime̵published_object_keysdepends_on_skipped_cells§errored$3103e636-3f0a-4e16-94f7-3da1a573ec3dqueued¤logsrunning¦outputbodyM

Hidden code

In Pluto, you can choose to hide/show the code for any cell.

For example: The cell below has hidden code – you only see the output. You need to edit this notebook to see the code behind the output.

mimetext/htmlrootassigneelast_run_timestampAڃ&ipersist_js_state·has_pluto_hook_features§cell_id$3103e636-3f0a-4e16-94f7-3da1a573ec3ddepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$db1ef6d1-7921-4035-8705-a0820048b785queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃ˜1persist_js_state·has_pluto_hook_features§cell_id$db1ef6d1-7921-4035-8705-a0820048b785depends_on_disabled_cells§runtime[published_object_keysdepends_on_skipped_cells§errored$3bca136c-115f-4dd1-ac4d-d14c23c538cequeued¤logsrunning¦outputbody"🐭"mimetext/plainrootassigneemouselast_run_timestampAڃ™EVpersist_js_state·has_pluto_hook_features§cell_id$3bca136c-115f-4dd1-ac4d-d14c23c538cedepends_on_disabled_cells§runtimeNpublished_object_keysdepends_on_skipped_cells§errored$58761686-b3c8-47f3-b05c-616f34ac71d9queued¤logsrunning¦outputbody

For more information on this, read about package management on the Pluto.jl wiki.

mimetext/htmlrootassigneelast_run_timestampAڃr@persist_js_state·has_pluto_hook_features§cell_id$58761686-b3c8-47f3-b05c-616f34ac71d9depends_on_disabled_cells§runtimeƇpublished_object_keysdepends_on_skipped_cells§errored$3323e930-31be-4b0b-8cf2-71a07a017758queued¤logsrunning¦outputbodyamimetext/htmlrootassigneelast_run_timestampAڃšDpersist_js_state·has_pluto_hook_features§cell_id$3323e930-31be-4b0b-8cf2-71a07a017758depends_on_disabled_cells§runtime Cpublished_object_keysdepends_on_skipped_cells§errored$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0queued¤logsrunning¦outputbody

Notebook files

Pluto notebooks are scripts

A neat thing: Pluto notebooks are saved as .jl files: they're just Julia scripts! You can send them to Julia programmers that don't use Pluto, and they can run the script just like that. Or you can write your code in a notebook, and then run it on a larger dataset from the command line.

And just in case you're wondering: Pluto notebook files will save your cells in the order they should be run, not the order in which they're displayed. So you can play with the order and still run the code as a script!

This is quite different from .ipynb files, which can only be run with Jupyter.

There are a few more notable differences in the files:

Pluto notebooks include packages

As we mentioned, Pluto comes with a built-in package manager, so the notebook file also includes info about package versions.

Pluto notebooks don't include output

You may already have noticed that the experience of opening a Pluto notebook is a bit different, because it doesn't come with pre-loaded output for each cell.

This comes with pros and cons: it allows Pluto notebooks to maintain a simpler file, but makes it a bit harder to "preview" a notebook.

If you want to send someone your notebook with output, a good way to do it is as an HTML export (on the top menu) - that file will show all the output you created, and also allow viewers to download the original notebook file.

Version management

If you work with Git, good news! Pluto notebook files are designed to work well with version management.

Jupyter notebooks are notorious for creating huge git diffs (a git diff is an overview of changes in the file). Jupyter notebooks are easy to read, but their raw files are not.

By contrast, the changes to a Pluto notebook are much easier to make sense of. Small changes to a notebook will result in small changes to the file. Nice!

mimetext/htmlrootassigneelast_run_timestampAڃupersist_js_state·has_pluto_hook_features§cell_id$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0depends_on_disabled_cells§runtime1published_object_keysdepends_on_skipped_cells§errored$3ed1ed94-8741-48a0-9d23-bb78499eec91queued¤logsrunning¦outputbody.

That's what we mean by reactivity in Pluto. Pluto analyses the dependencies between your code, and reruns cells when needed to keep everything up to date. This is very different from Jupyter, where you were in charge of deciding when to rerun cells!

mimetext/htmlrootassigneelast_run_timestampAڃ"Spersist_js_state·has_pluto_hook_features§cell_id$3ed1ed94-8741-48a0-9d23-bb78499eec91depends_on_disabled_cells§runtime|published_object_keysdepends_on_skipped_cells§errored$c4ece2cd-31f4-4c91-a59b-e520de13deddqueued¤logsrunning¦outputbodyt

We tried to create multiple cells that set the value of greatness, but that's not possible!

Why is this not allowed?

This is because Pluto's reactivity. What should the value of greatness be in this notebook?

Pluto also can't decide the proper dependency order between the three cells. Should greatness be (0 + 10) * 2) or (0 * 2) + 10 ?

We can't give an answer that everyone will agree on in every situation - so for clarity, Pluto just prohibits this kind of ambiguity. So the restriction forces you to write a notebook that is reproducible: it will give the same result no matter when/how you run the cells.

If you run into this error, you can do two things:

mimetext/htmlrootassigneelast_run_timestampAڃ*Dpersist_js_state·has_pluto_hook_features§cell_id$c4ece2cd-31f4-4c91-a59b-e520de13dedddepends_on_disabled_cells§runtime )published_object_keysdepends_on_skipped_cells§errored$03d3ade3-056a-4f16-9b31-d259879082c9queued¤logsrunning¦outputbodyق

When you change apples, then oranges is immediately updated! ⚡

mimetext/htmlrootassigneelast_run_timestampAڃ!ٰpersist_js_state·has_pluto_hook_features§cell_id$03d3ade3-056a-4f16-9b31-d259879082c9depends_on_disabled_cells§runtimeapublished_object_keysdepends_on_skipped_cells§errored$74a6102a-e09d-4ebb-9ef8-2511b0f46f58queued¤logsrunning¦outputbodyO

Cell order

You can put Pluto cells in any order, you code does not need to run top to bottom! Here the group_of_mice cell depends on mouse, but mouse comes second:

mimetext/htmlrootassigneelast_run_timestampAڃ$persist_js_state·has_pluto_hook_features§cell_id$74a6102a-e09d-4ebb-9ef8-2511b0f46f58depends_on_disabled_cells§runtime @published_object_keysdepends_on_skipped_cells§errored$d8b4d774-258d-4ef8-9bd9-586d19c785d2queued¤logsrunning¦outputbodyk

Try importing another package (like Measurements):

mimetext/htmlrootassigneelast_run_timestampAڃppersist_js_state·has_pluto_hook_features§cell_id$d8b4d774-258d-4ef8-9bd9-586d19c785d2depends_on_disabled_cells§runtimempublished_object_keysdepends_on_skipped_cells§errored$f6e66043-6773-470a-9a07-17283c878d79queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃ™persist_js_state·has_pluto_hook_features§cell_id$f6e66043-6773-470a-9a07-17283c878d79depends_on_disabled_cells§runtimeQ published_object_keysdepends_on_skipped_cells§errored$def86a18-7106-490d-a1f0-c3e48b42b8f6queued¤logsrunning¦outputbody"Frida"mimetext/plainrootassigneelast_run_timestampAڃšnpersist_js_state·has_pluto_hook_features§cell_id$def86a18-7106-490d-a1f0-c3e48b42b8f6depends_on_disabled_cells§runtimeCpublished_object_keysdepends_on_skipped_cells§errored$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70queued¤logsrunning¦outputbody=

Ah, Pluto cells must be a single expression. Not to worry - as you can see, the error message lets you pick a solution (you can click on the two options). Either split up the cell in two:

cat = "🐈"
dog = "🐕"

... or write a cell with a begin ... end block:

begin
	cat = "🐈"
	dog = "🐕"
end
mimetext/htmlrootassigneelast_run_timestampAڃpްpersist_js_state·has_pluto_hook_features§cell_id$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70depends_on_disabled_cells§runtimempublished_object_keysdepends_on_skipped_cells§errored$94991d24-6aad-4361-a8e5-5e2c1f15c53cqueued¤logsrunning¦outputbodymsgAsyntax: extra token after end of expression Boundaries: [14, 26]stacktracesource_packagefilesyntax error.jlfuncthrow_syntax_errorcall_short#throw_syntax_error(syntax_err::Any)inlined£urlpath[/home/runner/.julia/packages/Pluto/ckjML/src/runner/PlutoRunner/src/display/syntax error.jlcall#throw_syntax_error(syntax_err::Any)linfo_typeCore.CodeInstanceline̯parent_modulefrom_cŒsource_packagefileBPluto for Jupyter users.jl#==#94991d24-6aad-4361-a8e5-5e2c1f15c53cfuncmacro expansioncall_shortmacro expansioninlinedãurlpathp/home/runner/work/featured/featured/src/basic/Pluto for Jupyter users.jl#==#94991d24-6aad-4361-a8e5-5e2c1f15c53ccallmacro expansionlinfo_typeNothinglineparent_modulefrom_c«plain_errornsyntax: extra token after end of expression Boundaries: [14, 26] Stacktrace: [1] throw_syntax_error(syntax_err::Any) @ Pluto.PlutoRunner ~/.julia/packages/Pluto/ckjML/src/runner/PlutoRunner/src/display/syntax error.jl:175 [2] macro expansion @ ~/work/featured/featured/src/basic/Pluto for Jupyter users.jl#==#94991d24-6aad-4361-a8e5-5e2c1f15c53c:1 [inlined]mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampAڃo'persist_js_state·has_pluto_hook_features§cell_id$94991d24-6aad-4361-a8e5-5e2c1f15c53cdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$aff0754c-8e3a-4cbc-9697-0797e5d32fc2queued¤logsrunning¦outputbodymsguMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.stacktraceplain_erroruMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampAڃ—persist_js_state·has_pluto_hook_features§cell_id$aff0754c-8e3a-4cbc-9697-0797e5d32fc2depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$4df1d31c-db13-49a1-963b-337550cd2bdaqueued¤logsrunning¦outputbodyV

Why is this not allowed?

Coming from Jupyter, this can feel a bit frustrating. Jupyter programmers often divide up their notebook in "sections" or code, with each cell containing 3-10 expressions. Grouping expressions like this makes sense in Jupyter because you're in charge of rerunning cells. It's just more efficient and less error-prone to group related statements in a single cell.

In Pluto, you don't have to worry about that! Instead, Pluto's analysis of dependencies in your code works best when each cell defines only a single variable.

We find that it is almost always a good idea to split your code into more cells. The more cells, the more intermediate results that you can see.

mimetext/htmlrootassigneelast_run_timestampAڃp7persist_js_state·has_pluto_hook_features§cell_id$4df1d31c-db13-49a1-963b-337550cd2bdadepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$669323ca-aac3-415c-bbfc-14525447ccd8queued¤logsrunning¦outputbody

Tip

Use Ctrl + M in a cell to wrap it in md""" markers!

mimetext/htmlrootassigneelast_run_timestampAڃtpersist_js_state·has_pluto_hook_features§cell_id$669323ca-aac3-415c-bbfc-14525447ccd8depends_on_disabled_cells§runtime,Gpublished_object_keysdepends_on_skipped_cells§errored$1512a488-3d77-4161-9fd0-0ade53e75c34queued¤logsrunning¦outputbody
Can't change code?

If you are reading this notebook online, you need to install Pluto to run the notebook. Here is a video recording!

Screen capture video where I cange the value of apples, and oranges updates to match

mimetext/htmlrootassigneelast_run_timestampAڃ™ͭXpersist_js_state·has_pluto_hook_features§cell_id$1512a488-3d77-4161-9fd0-0ade53e75c34depends_on_disabled_cells§runtime;published_object_keysdepends_on_skipped_cells§errored$a7ea9146-86f6-4d2a-85a3-950f2e7bc102queued¤logsrunning¦outputbody8

Package management

Here is a neat thing in Pluto: it will manage your packages for you!

To use a package to your notebook, just write a cell importing it, and Pluto will automatically make sure that the right packages are installed. If you import a new package, it will be installed behind the scenes. If you remove the import, then Pluto will uninstall it.

In the cell below, click the ✔ button next to using PlutoUI to learn more about its status.

mimetext/htmlrootassigneelast_run_timestampAڃppersist_js_state·has_pluto_hook_features§cell_id$a7ea9146-86f6-4d2a-85a3-950f2e7bc102depends_on_disabled_cells§runtime xpublished_object_keysdepends_on_skipped_cells§errored$c12c3f7d-f91b-4395-9323-52a582a79bc6queued¤logsrunning¦outputbodymsguMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.stacktraceplain_erroruMultiple definitions for greatness Combine all definitions into a single reactive cell using a `begin ... end` block.mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampAڃ—persist_js_state·has_pluto_hook_features§cell_id$c12c3f7d-f91b-4395-9323-52a582a79bc6depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$e1c813e5-a393-4364-8494-687b98811a0bqueued¤logsrunning¦outputbody

Other programming languages

Jupyter was created to work with Julia, Python, and R (hence the name: JuPyteR), and can even be made compatible with other languages!

Pluto, however, is only ever going to be Julia environment. The core of Pluto is built in Julia, and Pluto's reactivity works by analysing your code. Jupyter is built to be largely language-agnostic, but Pluto decidedly isn't.

This comes with pros and cons: Pluto can do some cool stuff because it knows the language you're working in, but it doesn't have the flexibility that Jupyter does.

mimetext/htmlrootassigneelast_run_timestampAڃvrpersist_js_state·has_pluto_hook_features§cell_id$e1c813e5-a393-4364-8494-687b98811a0bdepends_on_disabled_cells§runtime7\published_object_keysdepends_on_skipped_cells§errored$773ac617-4e5d-46b9-92ff-b0d9a23e42f1queued¤logsrunning¦outputbody7

Why reactive?

Reactivity can save you some tedious work of having to rerun several cells when you change a variable, but it's more than a time-saver!

Because the output of your cells is always kept up-to-date, you won't have weird errors that depend on some code that you ran in your session but deleted over an hour ago. Likewise, when you shut down Pluto and open it the next day, all your notebooks will work exactly like yesterday.

Descriptive programming

Pluto offers an environment where changed code takes effect instantly and where deleted code leaves no trace. Unlike Jupyter or Matlab, there is no mutable workspace, but rather, an important guarantee:

At any instant, the program state is completely described by the code you see.

Try it!

Write your own code in the cells below!

mimetext/htmlrootassigneelast_run_timestampAڃ"ɰpersist_js_state·has_pluto_hook_features§cell_id$773ac617-4e5d-46b9-92ff-b0d9a23e42f1depends_on_disabled_cells§runtimeԴpublished_object_keysdepends_on_skipped_cells§errored$8e1faf5f-7b60-4b57-9902-e9d2531f0961queued¤logsrunning¦outputbody51mimetext/plainrootassigneeorangeslast_run_timestampAڃ™2persist_js_state·has_pluto_hook_features§cell_id$8e1faf5f-7b60-4b57-9902-e9d2531f0961depends_on_disabled_cells§runtimeCpublished_object_keysdepends_on_skipped_cells§errored$0948181e-b26c-421b-83b5-c9dceb71e804queued¤logsrunning¦outputbody🚂🚃🚃🚃🚃🚃🚃mimetext/plainrootassigneetrainlast_run_timestampAڃ™jpersist_js_state·has_pluto_hook_features§cell_id$0948181e-b26c-421b-83b5-c9dceb71e804depends_on_disabled_cells§runtimeͲpublished_object_keysdepends_on_skipped_cells§errored$f4d990a8-274a-4098-b4f9-ce1d39ec41a6queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampAڃ$Fpersist_js_state·has_pluto_hook_features§cell_id$f4d990a8-274a-4098-b4f9-ce1d39ec41a6depends_on_disabled_cells§runtimeSpublished_object_keysdepends_on_skipped_cells§errored±cell_dependencies0$1086228a-e28d-45c7-9153-c79378239e54precedence_heuristic cell_id$1086228a-e28d-45c7-9153-c79378239e54downstream_cells_mapupstream_cells_map@md_strgetindex$cdbcc440-858c-11ee-25d2-dd9d69531eefprecedence_heuristic cell_id$cdbcc440-858c-11ee-25d2-dd9d69531eefdownstream_cells_mapupstream_cells_map@md_strgetindex$2b91d104-921a-4d66-ac1f-a940cdb2d14cprecedence_heuristic cell_id$2b91d104-921a-4d66-ac1f-a940cdb2d14cdownstream_cells_mapupstream_cells_map@md_strgetindex$40ff93d6-1755-4258-9c15-3ae7be681d93precedence_heuristic cell_id$40ff93d6-1755-4258-9c15-3ae7be681d93downstream_cells_mapupstream_cells_map@md_strgetindex$447f49ce-1738-4987-a976-094174971ccbprecedence_heuristic cell_id$447f49ce-1738-4987-a976-094174971ccbdownstream_cells_mapupstream_cells_map@md_strgetindex$5dd0949a-82d1-4b27-8318-9b42065d0957precedence_heuristic cell_id$5dd0949a-82d1-4b27-8318-9b42065d0957downstream_cells_mapgreatness$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957upstream_cells_map*greatness$aff0754c-8e3a-4cbc-9697-0797e5d32fc2$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6precedence_heuristic cell_id$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6downstream_cells_mapupstream_cells_map@md_strgetindex$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbprecedence_heuristic cell_id$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbdownstream_cells_mapapples$8e1faf5f-7b60-4b57-9902-e9d2531f0961upstream_cells_map$c702dde3-6cb4-4444-ab1d-f1db95e6776aprecedence_heuristic cell_id$c702dde3-6cb4-4444-ab1d-f1db95e6776adownstream_cells_mapcount$def86a18-7106-490d-a1f0-c3e48b42b8f6upstream_cells_mapCoreBase:PlutoRunner.create_bondPlutoRunnerCore.applicable@bindBase.getSlider$4e75b797-dbba-4d2e-843e-4abb0f8de22cprecedence_heuristic cell_id$4e75b797-dbba-4d2e-843e-4abb0f8de22cdownstream_cells_mapupstream_cells_map$2a84a64a-b819-4246-8f77-99679691da61precedence_heuristic cell_id$2a84a64a-b819-4246-8f77-99679691da61downstream_cells_mapupstream_cells_map@md_strgetindex$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6precedence_heuristic cell_id$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6downstream_cells_mapupstream_cells_map$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5precedence_heuristic cell_id$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5downstream_cells_mapupstream_cells_map@md_strgetindex$a423fc4f-6000-4451-bc03-4035c9847753precedence_heuristic cell_id$a423fc4f-6000-4451-bc03-4035c9847753downstream_cells_mapupstream_cells_map@md_strgetindex$d3cf365d-ef7e-4a48-a32d-b050e69e5075precedence_heuristic cell_id$d3cf365d-ef7e-4a48-a32d-b050e69e5075downstream_cells_mapupstream_cells_map@md_strgetindex$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3eprecedence_heuristic cell_id$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3edownstream_cells_mapgroup_of_miceupstream_cells_mapmouse$3bca136c-115f-4dd1-ac4d-d14c23c538cerepeat$016f9e48-1672-481e-b642-d0c6bf67a5bcprecedence_heuristic cell_id$016f9e48-1672-481e-b642-d0c6bf67a5bcdownstream_cells_mapupstream_cells_map@md_strgetindex$4720cedc-502b-4c66-9c4a-98622c87cb04precedence_heuristic cell_id$4720cedc-502b-4c66-9c4a-98622c87cb04downstream_cells_mapupstream_cells_map@md_strgetindex$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0precedence_heuristic cell_id$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0downstream_cells_mapupstream_cells_map@md_strgetindex$5200e802-8080-4394-aa85-e2604c7279c8precedence_heuristic cell_id$5200e802-8080-4394-aa85-e2604c7279c8downstream_cells_mapupstream_cells_map@md_strgetindex$9c3cfd5e-b89c-4df2-9982-d581e9fc3730precedence_heuristic cell_id$9c3cfd5e-b89c-4df2-9982-d581e9fc3730downstream_cells_mapupstream_cells_map@md_strgetindex$ec2bcfd5-bd38-4801-ac38-2339bc782147precedence_heuristic cell_id$ec2bcfd5-bd38-4801-ac38-2339bc782147downstream_cells_mapupstream_cells_map$3103e636-3f0a-4e16-94f7-3da1a573ec3dprecedence_heuristic cell_id$3103e636-3f0a-4e16-94f7-3da1a573ec3ddownstream_cells_mapupstream_cells_map@md_strgetindex$db1ef6d1-7921-4035-8705-a0820048b785precedence_heuristiccell_id$db1ef6d1-7921-4035-8705-a0820048b785downstream_cells_mapPlutoUIupstream_cells_map$3bca136c-115f-4dd1-ac4d-d14c23c538ceprecedence_heuristic cell_id$3bca136c-115f-4dd1-ac4d-d14c23c538cedownstream_cells_mapmouse$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3eupstream_cells_map$58761686-b3c8-47f3-b05c-616f34ac71d9precedence_heuristic cell_id$58761686-b3c8-47f3-b05c-616f34ac71d9downstream_cells_mapupstream_cells_map@md_strgetindex$3323e930-31be-4b0b-8cf2-71a07a017758precedence_heuristic cell_id$3323e930-31be-4b0b-8cf2-71a07a017758downstream_cells_mapyourname$def86a18-7106-490d-a1f0-c3e48b42b8f6upstream_cells_mapCoreBaseTextFieldPlutoRunner.create_bondPlutoRunnerCore.applicable@bindBase.get$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0precedence_heuristic cell_id$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0downstream_cells_mapupstream_cells_map@md_strgetindex$3ed1ed94-8741-48a0-9d23-bb78499eec91precedence_heuristic cell_id$3ed1ed94-8741-48a0-9d23-bb78499eec91downstream_cells_mapupstream_cells_map@md_strgetindex$c4ece2cd-31f4-4c91-a59b-e520de13deddprecedence_heuristic cell_id$c4ece2cd-31f4-4c91-a59b-e520de13dedddownstream_cells_mapupstream_cells_map@md_strgetindex$03d3ade3-056a-4f16-9b31-d259879082c9precedence_heuristic cell_id$03d3ade3-056a-4f16-9b31-d259879082c9downstream_cells_mapupstream_cells_map@md_strgetindex$74a6102a-e09d-4ebb-9ef8-2511b0f46f58precedence_heuristic cell_id$74a6102a-e09d-4ebb-9ef8-2511b0f46f58downstream_cells_mapupstream_cells_map@md_strgetindex$d8b4d774-258d-4ef8-9bd9-586d19c785d2precedence_heuristic cell_id$d8b4d774-258d-4ef8-9bd9-586d19c785d2downstream_cells_mapupstream_cells_map@md_strgetindex$f6e66043-6773-470a-9a07-17283c878d79precedence_heuristic cell_id$f6e66043-6773-470a-9a07-17283c878d79downstream_cells_mapupstream_cells_map+$def86a18-7106-490d-a1f0-c3e48b42b8f6precedence_heuristic cell_id$def86a18-7106-490d-a1f0-c3e48b42b8f6downstream_cells_mapupstream_cells_mapyourname$3323e930-31be-4b0b-8cf2-71a07a017758repeatcount$c702dde3-6cb4-4444-ab1d-f1db95e6776a$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70precedence_heuristic cell_id$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70downstream_cells_mapupstream_cells_map@md_strgetindex$94991d24-6aad-4361-a8e5-5e2c1f15c53cprecedence_heuristic cell_id$94991d24-6aad-4361-a8e5-5e2c1f15c53cdownstream_cells_mapupstream_cells_mapPlutoRunnerPlutoRunner.throw_syntax_error$aff0754c-8e3a-4cbc-9697-0797e5d32fc2precedence_heuristic cell_id$aff0754c-8e3a-4cbc-9697-0797e5d32fc2downstream_cells_mapgreatness$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957upstream_cells_map$4df1d31c-db13-49a1-963b-337550cd2bdaprecedence_heuristic cell_id$4df1d31c-db13-49a1-963b-337550cd2bdadownstream_cells_mapupstream_cells_map@md_strgetindex$669323ca-aac3-415c-bbfc-14525447ccd8precedence_heuristic cell_id$669323ca-aac3-415c-bbfc-14525447ccd8downstream_cells_mapupstream_cells_map@md_strgetindex$1512a488-3d77-4161-9fd0-0ade53e75c34precedence_heuristic cell_id$1512a488-3d77-4161-9fd0-0ade53e75c34downstream_cells_mapupstream_cells_map@md_strdetailsgetindex$a7ea9146-86f6-4d2a-85a3-950f2e7bc102precedence_heuristic cell_id$a7ea9146-86f6-4d2a-85a3-950f2e7bc102downstream_cells_mapupstream_cells_map@md_strgetindex$c12c3f7d-f91b-4395-9323-52a582a79bc6precedence_heuristic cell_id$c12c3f7d-f91b-4395-9323-52a582a79bc6downstream_cells_mapgreatness$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957upstream_cells_map+greatness$aff0754c-8e3a-4cbc-9697-0797e5d32fc2$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957$e1c813e5-a393-4364-8494-687b98811a0bprecedence_heuristic cell_id$e1c813e5-a393-4364-8494-687b98811a0bdownstream_cells_mapupstream_cells_map@md_strgetindex$773ac617-4e5d-46b9-92ff-b0d9a23e42f1precedence_heuristic cell_id$773ac617-4e5d-46b9-92ff-b0d9a23e42f1downstream_cells_mapupstream_cells_map@md_strgetindex$8e1faf5f-7b60-4b57-9902-e9d2531f0961precedence_heuristic cell_id$8e1faf5f-7b60-4b57-9902-e9d2531f0961downstream_cells_maporangesupstream_cells_map+apples$b25c812b-7ec2-4e17-aa1b-e1a1407d29fb$0948181e-b26c-421b-83b5-c9dceb71e804precedence_heuristic cell_id$0948181e-b26c-421b-83b5-c9dceb71e804downstream_cells_maptrainupstream_cells_mapjoinfillText$f4d990a8-274a-4098-b4f9-ce1d39ec41a6precedence_heuristic cell_id$f4d990a8-274a-4098-b4f9-ce1d39ec41a6downstream_cells_mapupstream_cells_mapcell_execution_order0$db1ef6d1-7921-4035-8705-a0820048b785$cdbcc440-858c-11ee-25d2-dd9d69531eef$a423fc4f-6000-4451-bc03-4035c9847753$b25c812b-7ec2-4e17-aa1b-e1a1407d29fb$8e1faf5f-7b60-4b57-9902-e9d2531f0961$03d3ade3-056a-4f16-9b31-d259879082c9$1512a488-3d77-4161-9fd0-0ade53e75c34$3ed1ed94-8741-48a0-9d23-bb78499eec91$773ac617-4e5d-46b9-92ff-b0d9a23e42f1$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6$f4d990a8-274a-4098-b4f9-ce1d39ec41a6$74a6102a-e09d-4ebb-9ef8-2511b0f46f58$3bca136c-115f-4dd1-ac4d-d14c23c538ce$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3e$2b91d104-921a-4d66-ac1f-a940cdb2d14c$3103e636-3f0a-4e16-94f7-3da1a573ec3d$0948181e-b26c-421b-83b5-c9dceb71e804$9c3cfd5e-b89c-4df2-9982-d581e9fc3730$f6e66043-6773-470a-9a07-17283c878d79$2a84a64a-b819-4246-8f77-99679691da61$3323e930-31be-4b0b-8cf2-71a07a017758$c702dde3-6cb4-4444-ab1d-f1db95e6776a$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6$def86a18-7106-490d-a1f0-c3e48b42b8f6$ec2bcfd5-bd38-4801-ac38-2339bc782147$1086228a-e28d-45c7-9153-c79378239e54$447f49ce-1738-4987-a976-094174971ccb$c4ece2cd-31f4-4c91-a59b-e520de13dedd$5200e802-8080-4394-aa85-e2604c7279c8$94991d24-6aad-4361-a8e5-5e2c1f15c53c$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70$4df1d31c-db13-49a1-963b-337550cd2bda$a7ea9146-86f6-4d2a-85a3-950f2e7bc102$d8b4d774-258d-4ef8-9bd9-586d19c785d2$4e75b797-dbba-4d2e-843e-4abb0f8de22c$4720cedc-502b-4c66-9c4a-98622c87cb04$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5$d3cf365d-ef7e-4a48-a32d-b050e69e5075$58761686-b3c8-47f3-b05c-616f34ac71d9$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0$016f9e48-1672-481e-b642-d0c6bf67a5bc$669323ca-aac3-415c-bbfc-14525447ccd8$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0$e1c813e5-a393-4364-8494-687b98811a0b$40ff93d6-1755-4258-9c15-3ae7be681d93$5dd0949a-82d1-4b27-8318-9b42065d0957$aff0754c-8e3a-4cbc-9697-0797e5d32fc2$c12c3f7d-f91b-4395-9323-52a582a79bc6last_hot_reload_timeshortpathPluto for Jupyter users.jlprocess_statusreadypathH/home/runner/work/featured/featured/src/basic/Pluto for Jupyter users.jlpluto_versionv0.20.25last_save_timeAڃ cell_order0$cdbcc440-858c-11ee-25d2-dd9d69531eef$a423fc4f-6000-4451-bc03-4035c9847753$b25c812b-7ec2-4e17-aa1b-e1a1407d29fb$8e1faf5f-7b60-4b57-9902-e9d2531f0961$03d3ade3-056a-4f16-9b31-d259879082c9$1512a488-3d77-4161-9fd0-0ade53e75c34$3ed1ed94-8741-48a0-9d23-bb78499eec91$773ac617-4e5d-46b9-92ff-b0d9a23e42f1$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6$f4d990a8-274a-4098-b4f9-ce1d39ec41a6$74a6102a-e09d-4ebb-9ef8-2511b0f46f58$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3e$3bca136c-115f-4dd1-ac4d-d14c23c538ce$2b91d104-921a-4d66-ac1f-a940cdb2d14c$3103e636-3f0a-4e16-94f7-3da1a573ec3d$0948181e-b26c-421b-83b5-c9dceb71e804$9c3cfd5e-b89c-4df2-9982-d581e9fc3730$f6e66043-6773-470a-9a07-17283c878d79$2a84a64a-b819-4246-8f77-99679691da61$3323e930-31be-4b0b-8cf2-71a07a017758$c702dde3-6cb4-4444-ab1d-f1db95e6776a$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6$def86a18-7106-490d-a1f0-c3e48b42b8f6$ec2bcfd5-bd38-4801-ac38-2339bc782147$1086228a-e28d-45c7-9153-c79378239e54$447f49ce-1738-4987-a976-094174971ccb$aff0754c-8e3a-4cbc-9697-0797e5d32fc2$c12c3f7d-f91b-4395-9323-52a582a79bc6$5dd0949a-82d1-4b27-8318-9b42065d0957$c4ece2cd-31f4-4c91-a59b-e520de13dedd$5200e802-8080-4394-aa85-e2604c7279c8$94991d24-6aad-4361-a8e5-5e2c1f15c53c$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70$4df1d31c-db13-49a1-963b-337550cd2bda$a7ea9146-86f6-4d2a-85a3-950f2e7bc102$db1ef6d1-7921-4035-8705-a0820048b785$d8b4d774-258d-4ef8-9bd9-586d19c785d2$4e75b797-dbba-4d2e-843e-4abb0f8de22c$4720cedc-502b-4c66-9c4a-98622c87cb04$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5$d3cf365d-ef7e-4a48-a32d-b050e69e5075$58761686-b3c8-47f3-b05c-616f34ac71d9$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0$016f9e48-1672-481e-b642-d0c6bf67a5bc$669323ca-aac3-415c-bbfc-14525447ccd8$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0$e1c813e5-a393-4364-8494-687b98811a0b$40ff93d6-1755-4258-9c15-3ae7be681d93published_objectsnbpkginstall_time_nsn71instantiatedòinstalled_versionsPlutoUI0.7.81!__internal_julia_manifest_version1.12.6__internal_julia_version1.12.6terminal_outputsnbpkg_sync0 Waiting for other notebooks to finish Pkg operations... === ┌ Warning: The active manifest file at `/home/runner/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml` has an old format that is being maintained. │ To update to the new format, which is supported by Julia versions ≥ 1.6.2, run `import Pkg; Pkg.upgrade_manifest()` which will upgrade the format without re-resolving. │ To then record the julia version re-resolve with `Pkg.resolve()` and if there are resolve conflicts consider `Pkg.update()`. └ @ Pkg.Types /opt/hostedtoolcache/julia/1.12.6/x64/share/julia/stdlib/v1.12/Pkg/src/manifest.jl:383 Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml` Instantiating... === ┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version. └ @ ~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml:0 Precompiling... ===PlutoUI0 Waiting for other notebooks to finish Pkg operations... === ┌ Warning: The active manifest file at `/home/runner/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml` has an old format that is being maintained. │ To update to the new format, which is supported by Julia versions ≥ 1.6.2, run `import Pkg; Pkg.upgrade_manifest()` which will upgrade the format without re-resolving. │ To then record the julia version re-resolve with `Pkg.resolve()` and if there are resolve conflicts consider `Pkg.update()`. └ @ Pkg.Types /opt/hostedtoolcache/julia/1.12.6/x64/share/julia/stdlib/v1.12/Pkg/src/manifest.jl:383 Resolving... ===  Project No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Project.toml`  Manifest No packages added to or removed from `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml` Instantiating... === ┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version. └ @ ~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_qrujnhsylg/Manifest.toml:0 Precompiling... ===enabled÷restart_recommended_msgrestart_required_msgbusy_packageswaiting_for_permission,waiting_for_permission_but_probably_disabled«cell_inputs0$1086228a-e28d-45c7-9153-c79378239e54cell_id$1086228a-e28d-45c7-9153-c79378239e54codeEmd""" To learn more, take a look at the other featured notebooks! """metadatashow_logsèdisabled®skip_as_script«code_folded$cdbcc440-858c-11ee-25d2-dd9d69531eefcell_id$cdbcc440-858c-11ee-25d2-dd9d69531eefcodeImd""" # Pluto for Jupyter users [Jupyter](https://jupyter.org/) is another open source notebook environment, that works with Julia, Python, and R. If you're already familiar with Jupyter and are now trying out Pluto, this notebook is for you! We'll go over some key differences between Pluto and Jupyter. Let's get started! """metadatashow_logsèdisabled®skip_as_script«code_folded$2b91d104-921a-4d66-ac1f-a940cdb2d14ccell_id$2b91d104-921a-4d66-ac1f-a940cdb2d14ccodemd""" This is also fine in Jupyter, but it's discouraged. Running cells yourself is easier when you can run things top-to-bottom, and the "run all cells" command also requires your cells work like that. Because Pluto analyses the dependencies in your code, playing with the order of cells is no problem at all! You can place cells in the order that you want to *present* them in – you might want to show results first, and put your functions and calculations at the bottom of the notebook. """metadatashow_logsèdisabled®skip_as_script«code_folded$40ff93d6-1755-4258-9c15-3ae7be681d93cell_id$40ff93d6-1755-4258-9c15-3ae7be681d93codemd""" ## Wrapping up That's it! I encourage you to make your own notebooks and play around with Pluto yourself. You can also take a look at Pluto's featured notebooks (on the home page) which show you a bit more of what you can do with Pluto! """metadatashow_logsèdisabled®skip_as_script«code_folded$447f49ce-1738-4987-a976-094174971ccbcell_id$447f49ce-1738-4987-a976-094174971ccbcodeWmd""" ## Re-assigning variables Here' s something that you **cannot do** in Pluto: """metadatashow_logsèdisabled®skip_as_script«code_folded$5dd0949a-82d1-4b27-8318-9b42065d0957cell_id$5dd0949a-82d1-4b27-8318-9b42065d0957codegreatness = greatness * 2metadatashow_logsèdisabled®skip_as_script«code_folded$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6cell_id$b04a791f-7eb9-40eb-9cab-ff38fbc6cca6codejmd""" Now we have two global variables, **`yourname`** and **`count`** that we can use in other cells: """metadatashow_logsèdisabled®skip_as_script«code_folded$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbcell_id$b25c812b-7ec2-4e17-aa1b-e1a1407d29fbcodeapples = 1metadatashow_logsèdisabled®skip_as_script«code_folded$c702dde3-6cb4-4444-ab1d-f1db95e6776acell_id$c702dde3-6cb4-4444-ab1d-f1db95e6776acode@bind count Slider(1:100)metadatashow_logsèdisabled®skip_as_script«code_folded$4e75b797-dbba-4d2e-843e-4abb0f8de22ccell_id$4e75b797-dbba-4d2e-843e-4abb0f8de22ccodemetadatashow_logsèdisabled®skip_as_script«code_folded$2a84a64a-b819-4246-8f77-99679691da61cell_id$2a84a64a-b819-4246-8f77-99679691da61codeٚmd""" ## Interactivity with `@bind` You can use **`@bind`** and [PlutoUI.jl](https://github.com/JuliaPluto/PlutoUI.jl) to write interactive notebooks! """metadatashow_logsèdisabled®skip_as_script«code_folded$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6cell_id$6ba28587-3612-45bb-a5fa-5e1ce8fa3aa6codemetadatashow_logsèdisabled®skip_as_script«code_folded$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5cell_id$74ff3d85-a6f4-4ae4-8502-18cf7a180ac5codemd""" ### Reproducibility The package manager does some other neat stuff too. As you're probably aware, the good folks maintaining packages will release new versions over time. That's great, but it can cause issues with compatibility. Because of this, it can be useful if you've written down somewhere which versions of each package you were using - and if you're running someone else's code, you can avoid errors by using the same versions they used. In Pluto all of that happens automatically: your package environment is stored inside the notebook file. When someone else opens your notebook with Pluto, the exact same package environment will be used, and packages will work on their computer. """metadatashow_logsèdisabled®skip_as_script«code_folded$a423fc4f-6000-4451-bc03-4035c9847753cell_id$a423fc4f-6000-4451-bc03-4035c9847753codemd""" ## Reactivity The most notable difference between Pluto and Jupyter is **reactivity**. Here we have two cells: one defines `apples`, and one defines `oranges`, which depends on `apples`. Try changing the value of `apples` here, and see what happens! """metadatashow_logsèdisabled®skip_as_script«code_folded$d3cf365d-ef7e-4a48-a32d-b050e69e5075cell_id$d3cf365d-ef7e-4a48-a32d-b050e69e5075codePmd""" !!! tip If you're used to doing your own package management and you don't want Pluto to take over, don't worry! When you use `Pkg.activate(...)` inside a notebook, [the package manager will be disabled](https://github.com/fonsp/Pluto.jl/wiki/%F0%9F%8E%81-Package-management#advanced-set-up-an-environment-with-pkgactivate). """metadatashow_logsèdisabled®skip_as_script«code_folded$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3ecell_id$807b1586-8b3e-4cb1-9a9d-8ca66a28ec3ecode group_of_mice = repeat(mouse, 3)metadatashow_logsèdisabled®skip_as_script«code_folded$016f9e48-1672-481e-b642-d0c6bf67a5bccell_id$016f9e48-1672-481e-b642-d0c6bf67a5bccode9md""" This cell contains some **text** in *Markdown*! """metadatashow_logsèdisabled®skip_as_script«code_folded$4720cedc-502b-4c66-9c4a-98622c87cb04cell_id$4720cedc-502b-4c66-9c4a-98622c87cb04code4md""" ### But that's slow! In Julia, packages are always installed globally, while _environments_ (including notebooks) only store **version information**, not the package code itself. This means that multiple notebooks that use the same version of `Plots` will not lead to more disk usage or precompile time. This is different from `venv` in Python/pip, or `node_modules` in NodeJS/npm, where every environment contains copies of package code by default. Julia's package manager is designed to work well with many package environments on the same computer. """metadatashow_logsèdisabled®skip_as_script«code_folded$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0cell_id$8bbe13ff-f643-4ed0-aacf-9bafaa7c59c0codemd""" ## Markdown cells Unlike Jupyter, Pluto doesn't have text cells or markdown cells. Every cell is just Julia code. However, you can write markdown expressions in Julia, and those will be nicely displayed by Pluto. Like this: """metadatashow_logsèdisabled®skip_as_script«code_folded$5200e802-8080-4394-aa85-e2604c7279c8cell_id$5200e802-8080-4394-aa85-e2604c7279c8codeهmd""" ## Multiple expressions per cell When you start programming your first Pluto notebook, you'll probably run in to this error: """metadatashow_logsèdisabled®skip_as_script«code_folded$9c3cfd5e-b89c-4df2-9982-d581e9fc3730cell_id$9c3cfd5e-b89c-4df2-9982-d581e9fc3730codemd""" ## Hidden output Just like in Jupyter and the Julia REPL, you can **hide output** by adding a `;` at the end of you code. **For example:** this cell has **visible code** but **hidden output**. """metadatashow_logsèdisabled®skip_as_script«code_folded$ec2bcfd5-bd38-4801-ac38-2339bc782147cell_id$ec2bcfd5-bd38-4801-ac38-2339bc782147codemetadatashow_logsèdisabled®skip_as_script«code_folded$3103e636-3f0a-4e16-94f7-3da1a573ec3dcell_id$3103e636-3f0a-4e16-94f7-3da1a573ec3dcodemd""" ## Hidden code In Pluto, you can **choose to hide/show** the code for any cell. **For example:** The cell below has **hidden code** – you only see the output. You need to edit this notebook to see the code behind the output. """metadatashow_logsèdisabled®skip_as_script«code_folded$db1ef6d1-7921-4035-8705-a0820048b785cell_id$db1ef6d1-7921-4035-8705-a0820048b785codeusing PlutoUImetadatashow_logsèdisabled®skip_as_script«code_folded$3bca136c-115f-4dd1-ac4d-d14c23c538cecell_id$3bca136c-115f-4dd1-ac4d-d14c23c538cecodemouse = "🐭"metadatashow_logsèdisabled®skip_as_script«code_folded$58761686-b3c8-47f3-b05c-616f34ac71d9cell_id$58761686-b3c8-47f3-b05c-616f34ac71d9code٥md""" For more information on this, [read about package management on the Pluto.jl wiki](https://github.com/fonsp/Pluto.jl/wiki/%F0%9F%8E%81-Package-management). """metadatashow_logsèdisabled®skip_as_script«code_folded$3323e930-31be-4b0b-8cf2-71a07a017758cell_id$3323e930-31be-4b0b-8cf2-71a07a017758code)@bind yourname TextField(default="Frida")metadatashow_logsèdisabled®skip_as_script«code_folded$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0cell_id$e99b9c02-a31a-46d9-a5f1-9849c9d3cbe0codewmd""" ## Notebook files ### Pluto notebooks are scripts A neat thing: Pluto notebooks are saved as `.jl` files: they're just Julia scripts! You can send them to Julia programmers that don't use Pluto, and they can run the script just like that. Or you can write your code in a notebook, and then run it on a larger dataset from the command line. And just in case you're wondering: Pluto notebook files will save your cells in the order they should be _run_, not the order in which they're displayed. So you can play with the order and still run the code as a script! This is quite different from `.ipynb` files, which can only be run with Jupyter. There are a few more notable differences in the files: ### Pluto notebooks include packages As we mentioned, Pluto comes with a built-in package manager, so the notebook file also includes info about package versions. ### Pluto notebooks don't include output You may already have noticed that the experience of opening a Pluto notebook is a bit different, because it doesn't come with pre-loaded output for each cell. This comes with pros and cons: it allows Pluto notebooks to maintain a simpler file, but makes it a bit harder to "preview" a notebook. If you want to send someone your notebook _with output_, a good way to do it is as an HTML export (on the top menu) - that file will show all the output you created, and also allow viewers to download the original notebook file. ### Version management If you work with Git, good news! Pluto notebook files are designed to work well with version management. Jupyter notebooks are notorious for creating huge *git diffs* (a git diff is an overview of changes in the file). Jupyter notebooks are easy to read, but their raw files are not. By contrast, the changes to a Pluto notebook are much easier to make sense of. Small changes to a notebook will result in small changes to the file. Nice! """metadatashow_logsèdisabled®skip_as_script«code_folded$3ed1ed94-8741-48a0-9d23-bb78499eec91cell_id$3ed1ed94-8741-48a0-9d23-bb78499eec91codemd""" That's what we mean by reactivity in Pluto. Pluto analyses the _dependencies_ between your code, and reruns cells when needed to keep everything up to date. This is very different from Jupyter, where you were in charge of deciding when to rerun cells! """metadatashow_logsèdisabled®skip_as_script«code_folded$c4ece2cd-31f4-4c91-a59b-e520de13deddcell_id$c4ece2cd-31f4-4c91-a59b-e520de13deddcodeRmd""" We tried to create multiple cells that set the value of `greatness`, but that's not possible! > #### Why is this not allowed? > This is because Pluto's reactivity. What should the value of **`greatness`** be in this notebook? > > Pluto also can't decide the proper dependency order between the three cells. Should `greatness` be `(0 + 10) * 2)` or `(0 * 2) + 10` ? > > We can't give an answer that everyone will agree on in every situation - so for clarity, Pluto just prohibits this kind of ambiguity. So the restriction forces you to write a notebook that is **reproducible**: it will give the same result no matter when/how you run the cells. If you run into this error, you can do two things: - Wrap all definitions together into a single cell - Rename variables so they all have different names, e.g. `greatness_1`, `greatness_2`. """metadatashow_logsèdisabled®skip_as_script«code_folded$03d3ade3-056a-4f16-9b31-d259879082c9cell_id$03d3ade3-056a-4f16-9b31-d259879082c9codeNmd""" When you change `apples`, then `oranges` is immediately updated! ⚡ """metadatashow_logsèdisabled®skip_as_script«code_folded$74a6102a-e09d-4ebb-9ef8-2511b0f46f58cell_id$74a6102a-e09d-4ebb-9ef8-2511b0f46f58codemd""" ## Cell order You can put Pluto cells in **any order**, you code does not need to run top to bottom! Here the **`group_of_mice`** cell depends on **`mouse`**, but **`mouse`** comes second: """metadatashow_logsèdisabled®skip_as_script«code_folded$d8b4d774-258d-4ef8-9bd9-586d19c785d2cell_id$d8b4d774-258d-4ef8-9bd9-586d19c785d2code>md""" Try importing another package (like `Measurements`): """metadatashow_logsèdisabled®skip_as_script«code_folded$f6e66043-6773-470a-9a07-17283c878d79cell_id$f6e66043-6773-470a-9a07-17283c878d79code1 + 1;metadatashow_logsèdisabled®skip_as_script«code_folded$def86a18-7106-490d-a1f0-c3e48b42b8f6cell_id$def86a18-7106-490d-a1f0-c3e48b42b8f6coderepeat(yourname, count)metadatashow_logsèdisabled®skip_as_script«code_folded$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70cell_id$244ca1ba-c2dc-4713-9dd0-57ed0d19ba70codedmd""" Ah, Pluto cells must be a single expression. Not to worry - as you can see, the error message lets you pick a solution (you can click on the two options). Either split up the cell in two: ```julia cat = "🐈" ``` ```julia dog = "🐕" ``` ... or write a cell with a `begin` ... `end` block: ```julia begin cat = "🐈" dog = "🐕" end ``` """metadatashow_logsèdisabled®skip_as_script«code_folded$94991d24-6aad-4361-a8e5-5e2c1f15c53ccell_id$94991d24-6aad-4361-a8e5-5e2c1f15c53ccodecat = "🐈" dog = "🐕"metadatashow_logsèdisabled®skip_as_script«code_folded$aff0754c-8e3a-4cbc-9697-0797e5d32fc2cell_id$aff0754c-8e3a-4cbc-9697-0797e5d32fc2codegreatness = 0metadatashow_logsèdisabled®skip_as_script«code_folded$4df1d31c-db13-49a1-963b-337550cd2bdacell_id$4df1d31c-db13-49a1-963b-337550cd2bdacodemd""" > #### Why is this not allowed? > Coming from Jupyter, this can feel a bit frustrating. Jupyter programmers often divide up their notebook in "sections" or code, with each cell containing 3-10 expressions. Grouping expressions like this makes sense in Jupyter because you're in charge of rerunning cells. It's just more efficient and less error-prone to group related statements in a single cell. > > In Pluto, you don't have to worry about that! Instead, Pluto's analysis of dependencies in your code works best when each cell defines only a single variable. > > We find that it is **almost always a good idea to split your code into more cells**. The more cells, the more intermediate results that you can see. """metadatashow_logsèdisabled®skip_as_script«code_folded$669323ca-aac3-415c-bbfc-14525447ccd8cell_id$669323ca-aac3-415c-bbfc-14525447ccd8codeLmd""" !!! tip Use `Ctrl + M` in a cell to wrap it in `md""\"` markers! """metadatashow_logsèdisabled®skip_as_script«code_folded$1512a488-3d77-4161-9fd0-0ade53e75c34cell_id$1512a488-3d77-4161-9fd0-0ade53e75c34codeEdetails("Can't change code?", md""" If you are reading this notebook online, you need to install Pluto to run the notebook. Here is a video recording! ![Screen capture video where I cange the value of apples, and oranges updates to match](https://github.com/user-attachments/assets/fade5851-8493-4f93-a960-766d3048acec) """)metadatashow_logsèdisabled®skip_as_script«code_folded$a7ea9146-86f6-4d2a-85a3-950f2e7bc102cell_id$a7ea9146-86f6-4d2a-85a3-950f2e7bc102codemd""" ## Package management Here is a neat thing in Pluto: it will manage your packages for you! **To use a package to your notebook, just write a cell importing it**, and Pluto will automatically make sure that the right packages are installed. If you import a new package, it will be installed behind the scenes. If you remove the import, then Pluto will uninstall it. In the cell below, click the ✔ button next to `using PlutoUI` to learn more about its status. """metadatashow_logsèdisabled®skip_as_script«code_folded$c12c3f7d-f91b-4395-9323-52a582a79bc6cell_id$c12c3f7d-f91b-4395-9323-52a582a79bc6codegreatness = greatness + 10metadatashow_logsèdisabled®skip_as_script«code_folded$e1c813e5-a393-4364-8494-687b98811a0bcell_id$e1c813e5-a393-4364-8494-687b98811a0bcode9md""" ## Other programming languages Jupyter was created to work with Julia, Python, and R (hence the name: JuPyteR), and can even be made compatible with other languages! Pluto, however, is only ever going to be Julia environment. The core of Pluto is built in Julia, and Pluto's reactivity works by analysing your code. Jupyter is built to be largely language-agnostic, but Pluto decidedly isn't. This comes with pros and cons: Pluto can do some cool stuff because it knows the language you're working in, but it doesn't have the flexibility that Jupyter does. """metadatashow_logsèdisabled®skip_as_script«code_folded$773ac617-4e5d-46b9-92ff-b0d9a23e42f1cell_id$773ac617-4e5d-46b9-92ff-b0d9a23e42f1codeVmd""" > #### Why reactive? > Reactivity can save you some tedious work of having to rerun several cells when you change a variable, but it's more than a time-saver! > > Because the output of your cells is always kept up-to-date, you won't have weird errors that depend on some code that you ran in your session but deleted over an hour ago. Likewise, when you shut down Pluto and open it the next day, all your notebooks will work exactly like yesterday. > > > ##### Descriptive programming > Pluto offers an environment where changed code takes effect instantly and where deleted code leaves no trace. Unlike Jupyter or Matlab, there is **no mutable workspace**, but rather, an important guarantee: > > > _**At any instant**, the program state is **completely described** by the code you see._ ### Try it! Write your own code in the cells below! """metadatashow_logsèdisabled®skip_as_script«code_folded$8e1faf5f-7b60-4b57-9902-e9d2531f0961cell_id$8e1faf5f-7b60-4b57-9902-e9d2531f0961codeoranges = apples + 50metadatashow_logsèdisabled®skip_as_script«code_folded$0948181e-b26c-421b-83b5-c9dceb71e804cell_id$0948181e-b26c-421b-83b5-c9dceb71e804codectrain = let locomotive = "🚂" wagon = "🚃" Text("$(locomotive)$(join(fill(wagon, 6)))") endmetadatashow_logsèdisabled®skip_as_script«code_folded$f4d990a8-274a-4098-b4f9-ce1d39ec41a6cell_id$f4d990a8-274a-4098-b4f9-ce1d39ec41a6codemetadatashow_logsèdisabled®skip_as_script«code_folded«notebook_id$fdee4574-5519-11f1-9c30-c7bada604f84in_temp_dir¨metadatafrontmatterlicense_urlChttps://github.com/JuliaPluto/featured/blob/main/LICENSES/UnlicenseauthornamePluto.jlurlhttps://github.com/JuliaPlutoimageZhttps://github.com/JuliaPluto/featured/assets/6933510/19a10d1d-2a3b-42d0-9804-c1fd41c83bcdtitlePluto for Jupyter userstagsbasiclicenseUnlicensedescription;Coming to Pluto from Jupyter? Here's what you need to know!